import ReactWeui from 'react-weui';
const { Button, ButtonArea, Footer, FooterText } = ReactWeui;
import { Link, history } from 'umi';
// console.log(Button, ButtonArea);
import './test.less';
import { WhiteSpace } from 'antd-mobile';

const appid = 'wx17a43da7ecd43e0b';
const redirectUrl = window.location.origin + '/mp/login';

console.log(history);
console.log(
  wx.authorize.getAuthorizeUrl({
    appid: appid,
    redirect_uri: redirectUrl,
    scope: 'snsapi_base',
  }),
);

export default function TestPage() {
  return (
    <div className="page-container">
      <WhiteSpace size="lg"></WhiteSpace>
      <Link to="/wxpay-native" className="weui-btn weui-btn_default">
        Native支付
      </Link>
      <Link to="/setting" className="weui-btn weui-btn_default">
        设置
      </Link>
      <Link to="/setting/about" className="weui-btn weui-btn_default">
        关于
      </Link>
      <Link to="/setting/feedback" className="weui-btn weui-btn_default">
        意见反馈
      </Link>
      <div style={{ textAlign: 'center' }}>
        <span className="desc">关闭当前网页窗口接口</span>
      </div>
      <Footer>
        <FooterText>关闭当前网页窗口接口</FooterText>
      </Footer>
      <Button
        onClick={() => {
          wx.closeWindow();
        }}
      >
        关闭网页窗口
      </Button>
    </div>
  );
}
